package com.hc.demo.controller;

import com.hc.demo.dto.CalendarRequestDto;
import com.hc.demo.dto.ResultResponse;
import com.hc.demo.service.CalendarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CalendarController {

    //CalendarController---》CalendarService----》很多Mapper
    @Autowired
    CalendarService calendarService;

    /**
     * 界面需要某个月的日历
     * 和一些占位，不然第1天就会怼着周日
     * 日历中未来30天黑色高亮显示，并且有余号数量
     * @param calendarRequestDto
     * @return
     */
    @RequestMapping("/listCalendar")
    public ResultResponse listCalendar(@RequestBody CalendarRequestDto calendarRequestDto){


       // return calendarService.listCalendarWithRemainder(calendarRequestDto.getYear(),calendarRequestDto.getMonth(),calendarRequestDto.getHpId());
        return new ResultResponse(ResultResponse.SUCCESS_CODE,ResultResponse.SUCCESS_DESC,calendarService.listCalendarWithRemainder(calendarRequestDto.getYear(),calendarRequestDto.getMonth(),calendarRequestDto.getHpId()));
    }
}
